class Solution(object):
    def findTheLongestSubstring(self, s):
        now = [0, 0, 0, 0, 0]
        d = {'a': 0, 'e': 1, 'i': 2, 'o': 3, 'u': 4}
        max_len = 0
        f = {tuple(now): -1}
        for index, c in enumerate(s):
            if c in d:
                now[d[c]] = (now[d[c]] + 1) % 2
            p = tuple(now)
            if p in f:
                max_len = max(max_len, index - f[p])
            else:
                f[p] = index
        return max_len